optionally export private static fields of classes with friends#55
optionally export private static fields of classes with friends#55andrurogerz wants to merge 1 commit intocompnerd:mainfrom
Conversation
compnerd
left a comment
There was a problem hiding this comment.
I don't think that this is a particularly well formed conceptually. These are private fields, not protected fields. I'm not sure if these should be exported as part of the ABI. I think that the user should be explicit about exposing the private fields.
Sure. But I could argue that private members are part of a class' interface if it has friends, which is basically what I was going for here. I admit it is a stretch because the members definitely aren't part of the overall public interface. Regardless, I think you're arguing for something more along the lines of IDS callers explicitly specifying types they want exported regardless of access level. So in the example test I added, IDS would need to be explicitly told to export |
|
Not proceeding with this patch, per feedback. |
Purpose
Add a new command line option to IDS which enables it to export static, private fields of classes that have friend declarations. This fix specifically addresses feedback on llvm/llvm-project#136623 by automatically annotating
AnalysisKeyfields.Overview
Adds a new
--friendly-fieldscommand line argument to IDS to enable exporting private fields for friend access. When this new mode is enabled, private fields are exported byVisitVarDeclif the containing class has at least one friend declaration.NOTES:
Validation
Added a new test case.
Ran tests on Windows, Fedora, and MacOS.